package com.liyuxiang;

import org.junit.jupiter.api.Test;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

@SpringBootApplication
@MapperScan("com.liyuxiang.mapper")
public class TokenApplication {


    @Test
    public void TestBCryptPasswordEncoder(){
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        String encode = bCryptPasswordEncoder.encode("1234");
        System.out.println(encode);
        boolean matches = bCryptPasswordEncoder.matches("1234", "$2a$10$DY4LutfTFtzEGRVt/em/WOiejZyFltUOX./7PCeTaJBy3XSHKVJt2");
        System.out.println(matches);
    }

    public static void main(String[] args) {
        SpringApplication.run(TokenApplication.class,args);
    }
}
